﻿<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/tags/app" prefix="app"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> 
<HTML>
	<HEAD>
		<TITLE>添加角色组</TITLE>
		<META content="MSHTML 6.00.2800.1276" name=GENERATOR>
		<META http-equiv=Content-Type content="text/html; charset=UTF-8">
		<META http-equiv=Content-Style-Type content=text/css>
		<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
		<script language="javascript"
			src="<app:ContextPath/>/gxjs/style1/pageCommon.js"></script>
		<script language="javascript"
			src="<app:ContextPath/>/gxjs/style1/OaPubptPersonnelSelector.js"></script>
		<script language="javascript"
			src="<app:ContextPath/>/gxjs/style1/general.js"></script>
		<script language="javascript"
			src="<app:ContextPath/>/gxjs/style1/popWin.js"></script>
		<script language="javascript"
			src="<app:ContextPath/>/dwr/interface/GetRoles.js"></script>
		<script language="javascript"
			src="<app:ContextPath/>/dwr/util.js"></script>
		<script language="javascript"
			src="<app:ContextPath/>/dwr/engine.js"></script>
		<LINK href="<app:ContextPath/>/gxcss/style1/mainWin1.css"
			type="text/css" media="screen" rel="stylesheet">
		<LINK href="<app:ContextPath/>/gxcss/style1/mainWin2.css"
			type="text/css" media="screen" rel="stylesheet">
		<script type="text/javascript">
		var target;
		function firstDwr(obj){
			target=obj;
			GetRoles.selectRoleForSelect(callback12);
			
		}
		function callback12(data){
			var json1=eval("("+data+")");
			for (var one in json1) {
				var newoption = document.createElement("OPTION");
				newoption.text = json1[one];   
				newoption.value = one;
				target.add(newoption);
	        }
		}
		//保存新增的用户
function saveUserInfo(data){
    document.getElementById("saveflag").value=data;
    var username=document.getElementById("username").value;
    var password=document.getElementById("password").value;
    var email=document.getElementById("email").value;
    var tel=document.getElementById("tel").value;
    var desc=document.getElementById("desc").value;
    var srpname=document.getElementById("srpname").value;
    var userno=document.getElementById("userno").value;

    //var userename=document.getElementById("userename").value;
    //var userdept=document.getElementById("userdept").value;
    var userstatus=document.getElementById("userstatus").value;
    var usersite=document.getElementById("usersite").value;
    if(userno==null || userno==""){
	  alert("用户编号不能为空");
	  return;
    }
    if(username==null || username==""){
	  alert("用户名称不能为空");
	  return;
    }
    else if(password==null || password==""){
	  alert("用户密码不能为空");
	  return;
    }
    else if(userstatus==null || userstatus==""){
	  alert("用户状态不能为空");
	  return;
    }
    else if(usersite==null || usersite==""){
	  alert("用户站点不能为空");
	  return;
    }
    else if(email==null || email==""){
	  alert("用户邮件不能为空");
	  return;
    }
    else if(tel==null || tel==""){
	  alert("用户电话不能为空");
	  return;
    }
     else if(desc==null || desc==""){
	  alert("用户备注不能为空");
	  return;
    }
     else if(srpname==null || srpname==""){
	  alert("所属权限不能为空");
	  return;
    }
    if(window.confirm("您确定要添加吗！")){
       alert("添加成功!");
       document.all.actForm.submit(); 
       return true; 
    }else{
       alert("添加失败!");
       return false;
   }
}

function updatePass(){
	var oldPass=document.getElementById("oldpass").value;
	var newPass=document.getElementById("newpass").value;
	var qrnewPass=document.getElementById("qrnewpass").value;
	if(oldPass==null || oldPass==""){
	    alert("用户密码不能为空!!!");
	    return;
	}
	/*r
	else if(oldPass!=${sessionScope.userinfo.userpass}){
		alert("密码不正确,请重新输入!!!");
		return;
	}
	*/
	else if(newPass==null || newPass==""){
	    alert("新密码不能为空!!!");
	    return;
	}
	else if(qrnewPass==null || qrnewPass==""){
	    alert("新密码不能为空!!!");
	    return;
	}
	else if(newPass!=qrnewPass){
		alert("两次密码不一样,请重新输入!!!");
		return;
	}
	
	document.all.updatePassForm.submit();
	
}

function updatePassRet(){
	document.all.updatePassForm.reset();
}
</script>
	</HEAD>
	<body marginwidth="0" topmargin="0" leftmargin="0" onload="onLoad()" marginheight="0">
<!--		<DIV ID=MainArea>-->
<!--			<div id="PageHead"></div><a name="downloadLnk" href="/OAapp/WebObjects/OAapp.woa/wo/com.oa8000.proj.oasp12.Oasp1305/PkNWvdaiJJH03acX9Lea00/10.0.11.0.13.1"></a>-->
<!--			<CENTER>-->
<!--				<DIV CLASS=ItemBlock_Title1>-->
<!--				</DIV>-->
<form action="updatePass" name="updatePassForm">
				<DIV CLASS=ItemBlockBorder>
					<DIV CLASS=ItemBlock align="center">
						<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=70%>
							<TR HEIGHT=25>
								<TD WIDTH=50 ALIGN=RIGHT></TD>
								<TD WIDTH=120>&nbsp;旧密码</TD>
								<TD>
								<input type="hidden" id="userno" value="${sessionScope.userinfo.userno}">
								<input onfocus="this.select();" maxlength="50" class="InputStyle" style="width: 150px;" type="text" name="oldpass"/></TD>
								<TD WIDTH=40></TD>
							</TR>
							<TR HEIGHT=25>
								<TD ALIGN=RIGHT></TD>
								<TD>&nbsp;密  码</TD>
								<TD>
								<input onfocus="this.select();"  maxlength="50" class="InputStyle" style="width: 150px;" type="text" name="newpass" />
								</TD>
								<TD WIDTH=40></TD>
							</TR>
							<TR HEIGHT=100 VALIGN=top>
								<TD ALIGN=RIGHT></TD>
								<TD>&nbsp;确认密码</TD>
								<TD><input onfocus="this.select();" maxlength="50" class="InputStyle" style="width: 150px;" type="text" name="qrnewpass" /></TD>
								<TD></TD>
							</TR>
						</TABLE>
					</div>
					</DIV>
					
					<table>
					<tr>
					<td>
					<div onclick="updatePass();" class="FuncBtn">
					    <div class=FuncBtnHead></div>
						<div class=FuncBtnMemo>保存</div>
						<div class=FuncBtnTail></div>
					</div>
					</td>
					
					<td>
					<div onclick="updatePassRet();" class="FuncBtn">
					    <div class=FuncBtnHead></div>
						<div class=FuncBtnMemo>重置</div>
						<div class=FuncBtnTail></div>
					</div>
					</td>
					</tr>
				   </table>
					
					
				</form>
<!--				<DIV ID=InputDetailBar>-->
<!--					<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=10 ALIGN=center>-->
<!--						<TR>-->
<!--							<TD><a name="BTN0379700075003O8" href="javascript:addRoles();"></a>-->
<!---->
<!--<div onclick="addRoles();" class="FuncBtn"><div class=FuncBtnHead></div>-->
<!--	<div class=FuncBtnMemo>保存</div>-->
<!--	<div class=FuncBtnTail></div>-->
<!--</div>-->
<!--        </TD>-->
<!--							<TD><a name="BTN0379700075013J5" href="/OAapp/WebObjects/OAapp.woa/wo/com.oa8000.proj.oasp12.Oasp1305/PkNWvdaiJJH03acX9Lea00/10.0.11.0.29.0.0"></a>-->
<!--<div onclick="javascript:window.history.go(-1)" class="FuncBtn"><div class=FuncBtnHead></div>-->
<!--        <div class=FuncBtnMemo>返回</div>-->
<!--        <div class=FuncBtnTail></div></div></TD>-->
<!--						</TR>-->
<!--					</TABLE>-->
<!--				</DIV>-->
<!--			</CENTER>-->
<!--		</DIV>-->
</body>
</HTML>
